{"id":60392,"date":"2025-04-24T11:23:40","date_gmt":"2025-04-24T03:23:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60392\/"},"modified":"2025-04-24T11:23:40","modified_gmt":"2025-04-24T03:23:40","slug":"ecshop%e8%87%aa%e5%8a%a8%e5%88%86%e6%88%90%e5%87%bd%e6%95%b0%e7%a8%8b%e5%ba%8f%e4%bb%a3%e7%a0%81-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60392\/","title":{"rendered":"ecshop\u81ea\u52a8\u5206\u6210\u51fd\u6570\u7a0b\u5e8f\u4ee3\u7801"},"content":{"rendered":"<p>ecshop\u81ea\u52a8\u5206\u6210\u7a0b\u5e8f\u4ee3\u7801\uff0c\u5927\u6982\u903b\u8f91\uff1a   &nbsp;   \u540e\u53f0\u64cd\u4f5c\u4e00\u4e2a\u8ba2\u5355\u53d1\u8d27\u7684\u65f6\u5019\u8fdb\u884c\u81ea\u52a8\u5206\u6210\uff0c\u540e\u53f0\u53d6\u6d88\u53d1\u8d27\uff0c\u9000\u8d27\uff0c\u6539\u4e3a\u672a\u53d1\u8d27\u7684\u65f6\u5019\u53bb\u6389\u81ea\u52a8\u5206\u6210\u90e8\u5206\u3002   &nbsp;   \u6838\u5fc3\u4ee3\u7801\uff1alib_common.php   &nbsp;   \/\/\u5206\u6210\u79ef\u5206\u8ba1\u7b97   function fenchenjifen($usertype=3,$point){   $affiliate = unserialize($GLOBALS[&#8216;_CFG&#8217;][&#8216;affiliate&#8217;]);<br \/>\n<span> <\/span>   &nbsp;   if($usertype==3){<br \/>\n<span> <\/span>\/\/\u91c7\u8d2d   &nbsp;   &nbsp;   if ($affiliate[&#8216;config&#8217;][&#8216;level_register_up&#8217;])   {   $affiliate[&#8216;config&#8217;][&#8216;level_register_up&#8217;] \/= 100;   }   $point_cg = round($affiliate[&#8216;config&#8217;][&#8216;level_register_up&#8217;] * intval($point), 0);   return $point_cg;   }<br \/>\n<span> <\/span>   if($usertype==1){\/\/\u7ecf\u9500\u5546   if ($affiliate[&#8216;config&#8217;][&#8216;level_money_all&#8217;])   {   $affiliate[&#8216;config&#8217;][&#8216;level_money_all&#8217;] \/= 100;   }   $point_cg = round($affiliate[&#8216;config&#8217;][&#8216;level_money_all&#8217;] * intval($point), 0);   return $point_cg;   }<br \/>\n<span> <\/span>   if($usertype==2){\/\/\u8d22\u52a1   if ($affiliate[&#8216;config&#8217;][&#8216;level_register_all&#8217;])   {   $affiliate[&#8216;config&#8217;][&#8216;level_register_all&#8217;] \/= 100;   }   $point_cg = round($affiliate[&#8216;config&#8217;][&#8216;level_register_all&#8217;] * intval($point), 0);   return $point_cg;   }<br \/>\n<span> <\/span>   &nbsp;   &nbsp;   &nbsp;   }   &nbsp;   &nbsp;   \/**   *&nbsp;   * @param undefined $order \u8ba2\u5355\u4fe1\u606f   * @param undefined $buyuser \u8d2d\u4e70\u8005\u4fe1\u606f   * @param undefined $integral \u8ba1\u7b97\u79ef\u5206   * $type = 1 \u589e\u52a0 $type=-1 \u64a4\u9500   * \u5206\u6210log\u72b6\u600199   *\/   function fun_fencheng_change($order,$buyuser,$integral=array(),$type=1){\/\/\u5e97\u94fa\u5206\u6210\u8ba1\u7b97   if(intval($order[&#8216;parent_shopid&#8217;])==0) return false;   if(!is_array($buyuser)) return false;   &nbsp;   $order_id=$order[&#8216;order_id&#8217;];   $separate_by=99;   switch($buyuser[&#8216;usertype&#8217;]){   case &#8216;0&#8217;:\/\/\u8d2d\u4e70\u8005\u7c7b\u578b   $row = $GLOBALS[&#8216;db&#8217;]-&gt;getRow(&#8220;SELECT * from &#8221; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;users&#8217;) . &#8221; u &#8220;.   &#8221; WHERE u.shopid =&#8221;.$order[&#8216;parent_shopid&#8217;].&#8221; and u.usertype=1&#8243;&nbsp;   );\/\/\u83b7\u53d6pid   &nbsp;   $up_uid = $row[&#8216;user_id&#8217;];<br \/>\n<span> <\/span>   if(!empty($up_uid) &amp;&amp; $up_uid &gt; 0)   {   $money=$point=0;<br \/>\n<span> <\/span>   $point=<br \/>\n<span> <\/span>fenchenjifen(1,$integral[&#8216;custom_points&#8217;]);<br \/>\n<span> <\/span>   &nbsp;   \/\/ $info = sprintf($GLOBALS[&#8216;_LANG&#8217;][&#8216;separate_info&#8217;], $order[&#8216;order_sn&#8217;], $money, $point);   $info=&#8221;\u8ba2\u5355&#8221;.$order[&#8216;order_sn&#8217;].&#8221;\u5206\u6210\u83b7\u5f97\u79ef\u5206\uff1a&#8221;.$point;   log_account_change($up_uid, $money, 0, ($type)*$point, ($type)*$point, $info);   \/\/var_dump($info);<br \/>\n<span> <\/span>   if($type==1){<br \/>\n<span> <\/span>   &nbsp;   write_affiliate_log1($order_id, $up_uid, $row[&#8216;user_name&#8217;], $money, $point, $separate_by);   }else{   rollback_affiliate_log($order_id);   }   $orderupdate[&#8216;is_separate&#8217;]=$type==1?$separate_by:0;   $GLOBALS[&#8216;db&#8217;]-&gt;autoExecute($GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;order_info&#8217;),   $orderupdate, &#8216;UPDATE&#8217;, &#8220;order_id = &#8216;$order_id'&#8221;);   }   break;   case &#8216;3&#8217;:   $row = $GLOBALS[&#8216;db&#8217;]-&gt;getAll(&#8220;SELECT u.shopid,u.user_id,u.usertype, u.user_name FROM &#8221; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;users&#8217;) . &#8221; u &#8220;.   &#8221; WHERE u.shopid= &#8220;.$order[&#8216;parent_shopid&#8217;].&#8221; and u.usertype in (1,2)&#8221;);   foreach($row as $val){ \/\/ \u7ecf\u9500\u5546\u548c\u8d22\u52a1\u83b7\u5f97\u5206\u6210   if($val[&#8216;usertype&#8217;]==1){   $pointf = fenchenjifen(1,$integral[&#8216;custom_points&#8217;]);<br \/>\n<span> <\/span>   }   if($val[&#8216;usertype&#8217;]==2){   $pointf = fenchenjifen(2,$integral[&#8216;custom_points&#8217;]);<br \/>\n<span> <\/span>   }<br \/>\n<span> <\/span>   $up_uid = $val[&#8216;user_id&#8217;];   \/\/$info = sprintf($GLOBALS[&#8216;_LANG&#8217;][&#8216;separate_info&#8217;], $order[&#8216;order_sn&#8217;], $money, $pointf);   $info=&#8221;\u8ba2\u5355&#8221;.$order[&#8216;order_sn&#8217;].&#8221;\u5206\u6210\u83b7\u5f97\u79ef\u5206\uff1a&#8221;.$pointf;   log_account_change($up_uid, $money, 0, ($type)*$pointf, ($type)*$pointf, $info);   &nbsp;   if($type==1){<br \/>\n<span> <\/span>   write_affiliate_log1($order_id, $up_uid, $val[&#8216;user_name&#8217;], $money, $pointf, $separate_by);   }else{   rollback_affiliate_log($order_id);   }   $orderupdate[&#8216;is_separate&#8217;]=$type==1?$separate_by:0;   $GLOBALS[&#8216;db&#8217;]-&gt;autoExecute($GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;order_info&#8217;),   $orderupdate, &#8216;UPDATE&#8217;, &#8220;order_id = &#8216;$order_id'&#8221;);<br \/>\n<span> <\/span>   }   &nbsp;   break;   }   return true;   }   &nbsp;   \/**   *&nbsp;   * @param undefined $oid   * @param undefined $uid   * @param undefined $username   * @param undefined $money   * @param undefined $point   * @param undefined $separate_by   * \u5199\u5165\u8ba2\u5355\u5206\u6210 log   *\/   function write_affiliate_log1($oid, $uid, $username, $money, $point, $separate_by)   {   $time = gmtime();   $sql = &#8220;INSERT INTO &#8221; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;affiliate_log&#8217;) . &#8220;( order_id, user_id, user_name, time, money, point, separate_type)&#8221;.   &#8221; VALUES ( &#8216;$oid&#8217;, &#8216;$uid&#8217;, &#8216;$username&#8217;, &#8216;$time&#8217;, &#8216;$money&#8217;, &#8216;$point&#8217;, $separate_by)&#8221;;   if ($oid)   {   $GLOBALS[&#8216;db&#8217;]-&gt;query($sql);   }   }   &nbsp;   \/\/\u64a4\u9500\u8ba2\u5355\u5206\u6210   function rollback_affiliate_log($order_id,$falg=-2){   $sql = &#8220;UPDATE &#8221; . $GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;affiliate_log&#8217;) .   &#8221; SET separate_type = &#8216;$falg'&#8221; .   &#8221; WHERE order_id = &#8216;$order_id'&#8221;;   $GLOBALS[&#8216;db&#8217;]-&gt;query($sql);   }   &nbsp;   \u9700\u8981\u6ce8\u610f\u7684\u70b9\uff1a   &nbsp;   \u540e\u53f0\u53d1\u8d27\u7a0b\u5e8f\u5728admin\/order.php   &nbsp;   \u9700\u8981\u4fee\u6539\u7684\u5730\u65b9\u6709\uff1a \u53d1\u8d27 866\u884c \uff0c\u53d6\u6d88\u53d1\u8d27 1035\u884c \u6539\u4e3a\u672a\u53d1\u8d27 3961\u884c \u9000\u8d274132\u884c\u3002   &nbsp;   \u672c\u4ee3\u7801\u53ea\u8ba1\u7b97\u5206\u6210\u90e8\u5206\u3002\u81ea\u5df1\u4e0b\u5355\u90e8\u5206\u53e6\u5916\u3002   &nbsp;   \u8fd9\u4e2a\u4ee3\u7801\u662f\u6309\u7167\u5e97\u94faID\u5206\u6210\uff0c\u591a\u5546\u6237\u7684\u3002\u4e3aecshop\u4e8c\u6b21\u5f00\u53d1\u7248\u3002\u65e0\u6cd5\u7528\u4e8e\u539f\u7248\u3002   &nbsp;   \u8c03\u7528\u5206\u6210\uff1a fun_fencheng_change($order,$user,$integral,1);   \u53d6\u6d88\u5206\u6210\uff1a fun_fencheng_change($order,$user,$integral,-1);  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>ecshop\u81ea\u52a8\u5206\u6210\u7a0b\u5e8f\u4ee3\u7801\uff0c\u5927\u6982\u903b\u8f91\uff1a &nbsp; \u540e\u53f0\u64cd\u4f5c\u4e00\u4e2a\u8ba2\u5355\u53d1\u8d27\u7684\u65f6\u5019\u8fdb\u884c\u81ea\u52a8\u5206\u6210\uff0c\u540e\u53f0\u53d6\u6d88\u53d1\u8d27\uff0c\u9000\u8d27\uff0c\u6539\u4e3a\u672a\u53d1\u8d27\u7684\u65f6\u5019\u53bb\u6389\u81ea\u52a8\u5206\u6210\u90e8\u5206\u3002 &nbsp; \u6838\u5fc3\u4ee3\u7801\uff1alib_common.php &nbsp; \/\/\u5206\u6210\u79ef\u5206\u8ba1\u7b97 function fenchenjifen($usertype=3,$point){ $affiliate = unserialize($GLOBALS[&#8216;_CFG&#8217;][&#8216;affiliate&#8217;]); &nbsp; if($usertype==3){ \/\/\u91c7\u8d2d &nbsp; &nbsp; if ($affiliate[&#8216;config&#8217;][&#8216;level_register_up&#8217;]) { $affiliate[&#8216;config&#8217;][&#8216;level_register_up&#8217;] \/= 100; } $point_cg = round($affiliate[&#8216;config&#8217;][&#8216;level_register_up&#8217;] * intval($point), 0); return $point_cg; } if($usertype==1){\/\/\u7ecf\u9500\u5546 if ($affiliate[&#8216;config&#8217;][&#8216;level_money_all&#8217;]) { $affiliate[&#8216;config&#8217;][&#8216;level_money_all&#8217;] \/= 100; } $point_cg = round($affiliate[&#8216;config&#8217;][&#8216;level_money_all&#8217;] * intval($point), 0); return $point_cg; } if($usertype==2){\/\/\u8d22\u52a1 if ($affiliate[&#8216;config&#8217;][&#8216;level_register_all&#8217;]) { $affiliate[&#8216;config&#8217;][&#8216;level_register_all&#8217;] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-60392","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=60392"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60392\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}