{"id":199221,"date":"2025-05-03T09:12:06","date_gmt":"2025-05-03T01:12:06","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199221\/"},"modified":"2025-05-03T09:12:06","modified_gmt":"2025-05-03T01:12:06","slug":"ecshop%e6%b3%a8%e5%86%8c%e6%8e%a8%e8%8d%90%e9%80%81%e7%8e%b0%e9%87%91%e6%8f%92%e4%bb%b6%e5%bc%80%e5%8f%91","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199221\/","title":{"rendered":"ecshop\u6ce8\u518c\u63a8\u8350\u9001\u73b0\u91d1\u63d2\u4ef6\u5f00\u53d1"},"content":{"rendered":"<p>ecshop\u6ce8\u518c\u63a8\u8350\u9001\u73b0\u91d1\u63d2\u4ef6\u5f00\u53d1\uff0c\u597d\u6a21\u677f\u63d0\u4f9b\u8be5ecshop\u63d2\u4ef6\u6559\u7a0b<\/p>\n<p>  1:\u6a21\u677fuser_clips.dwt\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\u3002\u7528\u6765\u663e\u793a\u63a8\u8350\u7684\u4f1a\u5458\u5217\u8868   {if $action==&#8217;list_fuwu&#8217;}   &nbsp; &lt;table width=&#8221;100%&#8221; border=&#8221;0&#8243; cellpadding=&#8221;5&#8243; cellspacing=&#8221;1&#8243; bgcolor=&#8221;#dddddd&#8221;&gt;   &nbsp; &nbsp; &lt;tr align=&#8221;center&#8221;&gt;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;\u4f1a\u5458ID&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;\u4f1a\u5458\u540d\u79f0&lt;\/td&gt;   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;\u6ce8\u518c\u65f6\u95f4&lt;\/td&gt;   &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &lt;!&#8211; {foreach from=$my_comments key=level item=val name=affdb} &#8211;&gt;   &nbsp; &nbsp; &lt;tr align=&#8221;center&#8221;&gt;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$val.user_id}&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$val.user_name}&lt;\/td&gt;   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$val.reg_time}&lt;\/td&gt;   &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &lt;!&#8211; {\/foreach} &#8211;&gt;   &nbsp; &lt;\/table&gt;   &nbsp; &nbsp; &nbsp;&lt;!&#8211; #BeginLibraryItem &#8220;\/library\/pages.lbi&#8221; &#8211;&gt;&lt;!&#8211; #EndLibraryItem &#8211;&gt;   {\/if}   2:user.php\u4e2d\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801   elseif($action == &#8216;list_fuwu&#8217;){   $rankid = intval($_REQUEST[&#8216;rank_id&#8217;]);   $parent_id = intval($_REQUEST[&#8216;parent_id&#8217;]);   if($parent_id &amp;&amp; $rankid){   &nbsp; &nbsp; &nbsp;function get_comments($num,$start,$pid,$uk)   &nbsp; &nbsp;{   &nbsp; &nbsp; &nbsp; global $ecs;   &nbsp; &nbsp; &nbsp; global $db;   &nbsp; &nbsp; &nbsp; $sql =&#8221; &nbsp;select &nbsp;* from &#8220;.$ecs-&gt;table(&#8216;users&#8217;).&#8221; where parent_id = &#8216;$pid&#8217; and uk = &#8216;$uk&#8217; limit $start, $num&#8221;;   &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp;$res = $db-&gt;getAll($sql);   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp;return $res;   &nbsp; &nbsp;}   &nbsp; &nbsp;$sql = &#8220;SELECT COUNT(*) FROM &#8220;.$ecs-&gt;table(&#8216;users&#8217;).&#8221; where parent_id = &#8216;$parent_id&#8217; and uk = &#8216;$rankid'&#8221;;   &nbsp; &nbsp;$record_count = $GLOBALS[&#8216;db&#8217;]-&gt;getOne($sql);   &nbsp; &nbsp;$page = isset($_REQUEST[&#8216;page&#8217;]) ? intval($_REQUEST[&#8216;page&#8217;]) : 1;   &nbsp; &nbsp;   &nbsp; &nbsp;$pager = get_pager(&#8220;user.php?act=list_fuwu&amp;parent_id=$parent_id&amp;rank_id=$rankid&#8221;, array(), $record_count, $page, 10);   &nbsp; &nbsp;$msg_lists = get_comments(10, $pager[&#8216;start&#8217;],$parent_id, $rankid);   &nbsp; &nbsp; &nbsp; if($msg_lists){   &nbsp; &nbsp; foreach($msg_lists as $k =&gt; $v){   &nbsp; &nbsp; &nbsp;$msg_lists[$k][reg_time] = date(&#8220;Y-m-d&#8221;,$v[reg_time]);   &nbsp; &nbsp; }   &nbsp; &nbsp;}   &nbsp; &nbsp;$GLOBALS[&#8216;smarty&#8217;]-&gt;assign(&#8216;rand&#8217;, &nbsp; &nbsp; &nbsp;mt_rand());   &nbsp; &nbsp;   &nbsp; &nbsp;$GLOBALS[&#8216;smarty&#8217;]-&gt;assign(&#8216;pager&#8217;, $pager);   &nbsp; &nbsp;$GLOBALS[&#8216;smarty&#8217;]-&gt;assign(&#8216;my_comments&#8217;,$msg_lists);   &nbsp; &nbsp;$smarty-&gt;display(&#8216;user_clips.dwt&#8217;);   }   }   3:user.php\u4e2d\u589e\u4ee5\u4e0b\u4ee3\u7801\u3002\u7528\u6765\u8ba1\u7b97\u670d\u52a1\u8d39\u7528   \/\/ \u670d\u52a1\u8d39\u7528   elseif ($action == &#8216;fuwu&#8217;)   {   &nbsp; &nbsp; \/\/####################   \/\/\u7edf\u8ba1\u63a8\u8350   \/\/####################   $result = array();\/\/\u63a8\u8350\u4f1a\u5458\u8fd4\u56de\u7edf\u8ba1\u4fe1\u606f   $re = $db -&gt; getAll(&#8220;select rank_id,rank_name from &#8220;.$ecs-&gt;table(&#8216;user_rank&#8217;).&#8221; order by rank_id asc&#8221;);   if($re){   &nbsp; foreach($re as $k =&gt; $v){   &nbsp; &nbsp;if($v[&#8216;rank_name&#8217;]){   &nbsp; &nbsp; $n = $v[&#8216;rank_name&#8217;];   &nbsp; &nbsp; $result[$n][&#8216;money&#8217;] = 0;   &nbsp; &nbsp; \/\/\u53d6\u5f97\u4f1a\u5458\u6570\u91cf   &nbsp; &nbsp; $con = $db -&gt; getOne(&#8220;select count(*) c from &#8220;.$ecs-&gt;table(&#8216;users&#8217;).&#8221; where user_rank = &#8220;.$v[rank_id].&#8221; and parent_id =&#8221;.$_SESSION[&#8216;user_id&#8217;].&#8221; and user_rank = uk&#8221;);   &nbsp; &nbsp; \/\/\u7edf\u8ba1\u91d1\u989d   &nbsp; &nbsp; \/\/$string = &#8216;\u63a8\u8350&#8217;..&#8217;\u6ce8\u518c\u63d0\u6210&#8217;   &nbsp; &nbsp; $ua = $db -&gt; getAll(&#8220;select user_name from &#8220;.$ecs-&gt;table(&#8216;users&#8217;).&#8221; where user_rank = &#8220;.$v[rank_id].&#8221; and parent_id =&#8221;.$_SESSION[&#8216;user_id&#8217;].&#8221; and user_rank = uk&#8221;);   &nbsp; &nbsp; if($ua){   &nbsp; &nbsp; &nbsp;foreach($ua as $k =&gt; $v){   &nbsp; &nbsp; &nbsp; $string = &#8216;\u63a8\u8350&#8217;.$v[user_name].&#8217;\u6ce8\u518c\u63d0\u6210&#8217;;   &nbsp; &nbsp; &nbsp; $money = $db -&gt; getOne(&#8220;select user_money from &#8220;.$ecs-&gt;table(&#8216;account_log&#8217;).&#8221; where change_desc = &#8216;$string'&#8221;);   &nbsp; &nbsp; &nbsp; $result[$n][&#8216;money&#8217;]+= $money;\/\/\u8ba1\u7b97\u63a8\u8350\u91d1\u989d   &nbsp; &nbsp; &nbsp;}   &nbsp; &nbsp; }   &nbsp; &nbsp; $result[$n][&#8216;num&#8217;] &nbsp;= $con;   &nbsp; &nbsp; $result[$n][&#8216;rank_id&#8217;] &nbsp;= $v[&#8216;rank_id&#8217;];   &nbsp; &nbsp;}   &nbsp; }   }   &nbsp;   \/\/#################   \/\/\u683c\u5f0f\u5316\u91d1\u989d   \/\/#################   if($result){   &nbsp; foreach($result as $k =&gt; $v){   &nbsp; &nbsp;$result[$k][&#8216;money&#8217;] = &nbsp;price_format($v[&#8216;money&#8217;], false);   &nbsp; }   }   $smarty -&gt; assign(&#8216;affdb&#8217;,$result);   &nbsp; &nbsp; $smarty-&gt;assign(&#8216;shopname&#8217;, $_CFG[&#8216;shop_name&#8217;]);   &nbsp; &nbsp; $smarty-&gt;assign(&#8216;userid&#8217;, $user_id);   &nbsp; &nbsp; $smarty-&gt;assign(&#8216;shopurl&#8217;, $ecs-&gt;url());   &nbsp; &nbsp; $smarty-&gt;assign(&#8216;logosrc&#8217;, &#8216;themes\/&#8217; . $_CFG[&#8216;template&#8217;] . &#8216;\/images\/logo.gif&#8217;);   &nbsp; &nbsp; $smarty-&gt;display(&#8216;user_clips.dwt&#8217;);   }   4:admin\/affliliate.php\u4e2d\u7684list\u4e2d\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801   \/\/##################   \/\/\u63a8\u8350VIP\u4f1a\u5458\u9001\u73b0\u91d1   \/\/##################   $re = $db -&gt; getAll(&#8220;select * from &#8220;.$ecs-&gt;table(&#8216;user_rank&#8217;).&#8221; order by rank_id&#8221;);   $smarty -&gt; assign(&#8216;rank&#8217;,$re);   \/\/##################   \/\/\u63a8\u8350VIP\u4f1a\u5458\u9001\u73b0\u91d1   \/\/##################   &nbsp;   5:admin\/affliliate.php\u4e2d\u7684updata\u589e\u4ee5\u4e0b\u4ee3\u7801   if($_POST[&#8216;rank&#8217;]){   &nbsp;&nbsp;   &nbsp; $ar = array_combine($_POST[&#8216;rn&#8217;],$_POST[&#8216;rank&#8217;]);   &nbsp; if($ar){   &nbsp; &nbsp;foreach($ar as $k =&gt; $v){   &nbsp; &nbsp; $sql = &#8221; update &#8220;.$ecs-&gt;table(&#8216;user_rank&#8217;).&#8221; set qian = &#8220;.$v.&#8221; where rank_id = $k&#8221;;   &nbsp; &nbsp; $db -&gt; query($sql);   &nbsp; &nbsp;}   &nbsp; }   &nbsp;&nbsp;   }   5\uff1aaffliate.htm\u4e2d\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801   &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221; class=&#8221;label&#8221;&gt;\u63a8\u8350VIP\u4f1a\u5458\u9001\u73b0\u91d1:&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;   &nbsp; &nbsp; &nbsp;{foreach from = $rank item = item}   &nbsp; &nbsp; &nbsp; &nbsp;{$item.rank_name}:&lt;input type=&#8221;text&#8221; name=&#8221;rank[]&#8221; value=&#8221;{$item.qian}&#8221; size=&#8221;3&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;input type=&#8221;hidden&#8221; name=&#8221;rn[]&#8221; value=&#8221;{$item.rank_id}&#8221;&gt;   &nbsp; &nbsp; &nbsp;{\/foreach}   &nbsp; &nbsp; &nbsp;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   6:user_clips.dwt\u4e2d\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\u3002\u7528\u6765\u5217\u8868\u63a8\u8350\u4fe1\u606f   &lt;table width=&#8221;100%&#8221; border=&#8221;0&#8243; cellpadding=&#8221;5&#8243; cellspacing=&#8221;1&#8243; bgcolor=&#8221;#dddddd&#8221;&gt;   &nbsp; &nbsp; &lt;tr align=&#8221;center&#8221;&gt;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$lang.affiliate_lever}&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$lang.affiliate_num}&lt;\/td&gt;   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;\u63d0\u6210\u91d1\u989d&lt;\/td&gt;   &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &lt;!&#8211; {foreach from=$affdb1 key=level item=val name=affdb} &#8211;&gt;   &nbsp; &nbsp; &lt;tr align=&#8221;center&#8221;&gt;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$level}&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;&lt;a href=&#8221;?act=list_fuwu&amp;parent_id={$smarty.session.user_id}&amp;rank_id={$val.rank_id}&#8221;&gt;{$val.num}&lt;\/a&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &lt;td bgcolor=&#8221;#ffffff&#8221;&gt;{$val.money}&lt;\/td&gt;   &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &lt;!&#8211; {\/foreach} &#8211;&gt;   &nbsp; &lt;\/table&gt;   \u5b8c\u6bd5\uff01 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>ecshop\u6ce8\u518c\u63a8\u8350\u9001\u73b0\u91d1\u63d2\u4ef6\u5f00&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-199221","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=199221"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199221\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}