{"id":199563,"date":"2025-05-03T09:15:29","date_gmt":"2025-05-03T01:15:29","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199563\/"},"modified":"2025-05-03T09:15:29","modified_gmt":"2025-05-03T01:15:29","slug":"%e8%ae%a9ecshop%e6%8f%90%e7%8e%b0%e4%bc%9a%e5%91%98%e5%a2%9e%e5%8a%a0%e6%89%8b%e7%bb%ad%e8%b4%b9%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199563\/","title":{"rendered":"\u8ba9ecshop\u63d0\u73b0\u4f1a\u5458\u589e\u52a0\u624b\u7eed\u8d39\u529f\u80fd"},"content":{"rendered":"<p>\u7528ecshop\u7684\u65f6\u5019\u60f3\u4e3a\u6bcf\u4e2a\u4f1a\u5458\u7684\u63d0\u73b0\u589e\u52a0\u4e00\u4e2a\u624b\u7eed\u8d39\uff0c\u9700\u8981\u6d89\u53ca\u4fee\u6539\u7684\u6587\u4ef6\u4e3a user.php \u548c lib_clips.php \u4e8c\u4e2a\u6587\u4ef6<br \/>\n<br \/> 1.\u9996\u5148\u6253\u5f00includes\/lib_clips.php\u6587\u4ef6\uff0c\u5728\u6700\u540e\u7684 ?&gt; \u4e0a\u9762\u52a0\u5165\u5982\u4e0b\u4ee3\u7801 <\/p>\n<pre>\r\n\/**\r\n * \u67e5\u8be2\u4f1a\u5458\u624b\u7eed\u8d39\r\n * @access  public\r\n * @param   int     $user_id        \u4f1a\u5458ID\r\n * @return  int\r\n *\/\r\nfunction get_user_shouxufei($user_id)\r\n{\r\n    $sql = \"SELECT home_phone FROM \" .$GLOBALS['ecs']-&gt;table('users').\r\n           \" WHERE user_id = '$user_id'\";\r\n \r\n    return $GLOBALS['db']-&gt;getOne($sql);\r\n}<\/pre>\n<p> 2.\u6253\u5f00user.php\u6587\u4ef6\uff0c\u641c\u7d22\u5982\u4e0b\u4ee3\u7801\uff1a <\/p>\n<pre>\r\n        \/\/\u63d2\u5165\u4f1a\u5458\u8d26\u76ee\u660e\u7ec6\r\n        $amount = '-'.$amount;\r\n        $surplus['payment'] = '';\r\n        $surplus['rec_id']  = insert_user_account($surplus, $amount);<\/pre>\n<p> \u5c06\u4ee5\u4e0a\u4ee3\u7801\u4fee\u6539\u4e3a\u5982\u4e0b\uff1a <\/p>\n<pre>\r\n        \/\/\u63d2\u5165\u4f1a\u5458\u8d26\u76ee\u660e\u7ec6\r\n        $amount = '-'.$amount;\r\n        $surplus['payment'] = '';\r\n        $shouxufei = get_user_shouxufei($user_id);\r\n        $surplus['rec_id']  = insert_user_account($surplus, $amount*$shouxufei);<\/pre>\n<p> \u8fd9\u6837\u540e\u53f0\u4f1a\u5458\u5bb6\u5ead\u7535\u8bdd\u91cc\u9762\u586b\u5199\u7684\u503c\u5c31\u53ef\u4ee5\u4ee3\u8868\u624b\u7eed\u8d39\u4e86\uff0c\u5927\u5bb6\u53ef\u4ee5\u6309\u8fd9\u4e2a\u601d\u8def\u6539<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528ecshop\u7684\u65f6\u5019\u60f3\u4e3a\u6bcf\u4e2a\u4f1a\u5458&#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-199563","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199563","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=199563"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199563\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}