|
@@ -1,4 +1,5 @@
|
|
|
<?php
|
|
|
+
|
|
|
/**
|
|
|
* Created by PhpStorm.
|
|
|
* User: hp
|
|
@@ -10,23 +11,38 @@ namespace App\Modules\User\Services;
|
|
|
|
|
|
use App\Modules\Book\Models\BookGiftsSend;
|
|
|
use App\Modules\Book\Models\UserShelfBooks;
|
|
|
-use App\Modules\Book\Services\UserShelfBooksService;
|
|
|
use App\Modules\Subscribe\Models\BookOrder;
|
|
|
use App\Modules\Subscribe\Models\ChapterOrder;
|
|
|
-use App\Modules\Subscribe\Services\BookOrderService;
|
|
|
use App\Modules\Subscribe\Services\ChapterOrderService;
|
|
|
use App\Modules\User\Models\User;
|
|
|
use App\Modules\User\Models\UserEnv;
|
|
|
-use App\Modules\User\Models\UserSign;
|
|
|
use DB;
|
|
|
use App\Jobs\ActionTrigger;
|
|
|
+use App\Modules\BaseService;
|
|
|
use App\Modules\OfficialAccount\Models\DistributionSelfDefineConfig;
|
|
|
use App\Modules\Channel\Models\Channel;
|
|
|
use App\Modules\Trade\Models\Order;
|
|
|
use Redis;
|
|
|
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @method void setUserSendOrderStatic(int $uid,int $send_order_id)
|
|
|
+ * @method int getUserSendOrderStatic(int $uid)
|
|
|
+ */
|
|
|
class UserService
|
|
|
{
|
|
|
+ use BaseService;
|
|
|
+
|
|
|
+ public function setUserSendOrder(int $uid, int $send_order_id)
|
|
|
+ {
|
|
|
+ return Redis::hset('book_read:' . $uid, 'send_order_id', $send_order_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getUserSendOrder(int $uid)
|
|
|
+ {
|
|
|
+ return Redis::hGet('book_read:' . $uid, 'send_order_id');
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 创建用户
|
|
|
* $params
|
|
@@ -126,7 +142,7 @@ class UserService
|
|
|
*/
|
|
|
static function getUserByUnionAndChannelId($openid, $channel_id)
|
|
|
{
|
|
|
- return User::where('openid', $openid)->where('distribution_channel_id', $channel_id)->select('id', 'openid', 'unionid','balance','charge_balance','reward_balance')->first();
|
|
|
+ return User::where('openid', $openid)->where('distribution_channel_id', $channel_id)->select('id', 'openid', 'unionid', 'balance', 'charge_balance', 'reward_balance')->first();
|
|
|
}
|
|
|
|
|
|
static function getUserByOpenidAndChannelId($openid, $channel_id)
|
|
@@ -276,124 +292,128 @@ class UserService
|
|
|
|
|
|
return User::updateInfo($from_uid, ['balance' => 0, 'reward_balance' => 0, 'charge_balance' => 0]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 扔用户一些动作到队列,异步处理一些额外逻辑
|
|
|
- static function PushUserActionToQueue($action_type,$distribution_channel_id,$param){
|
|
|
- try{
|
|
|
-// \Log::info('PushUserActionToQueue_param_start:'.$distribution_channel_id.' action_type:'.$action_type. ' param:'.json_encode($param));
|
|
|
-
|
|
|
- // 判断站点是否需要额外逻辑
|
|
|
- $distribution_self_define_config = DistributionSelfDefineConfig::getDistributionSelfDefineConfig($distribution_channel_id,'action_call_ycsd');
|
|
|
- if(empty($distribution_self_define_config)){
|
|
|
-// \Log::info('not_action_call_ycsd:'.$distribution_channel_id);
|
|
|
- return '';
|
|
|
- }else{
|
|
|
- \Log::info('PushUserActionToQueue_param:'.$distribution_channel_id.' action_type:'.$action_type. ' param:'.json_encode($param));
|
|
|
- // 如果支付通道已经切换回去,则不推送了
|
|
|
-// $pay_merchant_id = env('YCSD_CALL_PAY_MERCHANT_ID');
|
|
|
-
|
|
|
- // 当前默认
|
|
|
- $pay_merchant_id = Redis::get('YCSD_CALL_PAY_MERCHANT_ID');
|
|
|
- $channel = Channel::getById($distribution_channel_id);
|
|
|
- $current_pay_merchant_id = isset($channel->pay_merchant_id)?$channel->pay_merchant_id:'';
|
|
|
- \Log::info('action_call_ycsd:'.$distribution_channel_id.' $pay_merchant_id:'.$pay_merchant_id.' $current_pay_merchant_id:'.$current_pay_merchant_id);
|
|
|
- if($current_pay_merchant_id != $pay_merchant_id){
|
|
|
- // 判断订单是否是默认支付,放行,切换期间的bug
|
|
|
- if($action_type == 'CallBackOrder'){
|
|
|
- $order = Order::getByTradeNo($distribution_channel_id, $param['order_sn']);
|
|
|
- if(isset($order->pay_merchant_id) && $order->pay_merchant_id == $pay_merchant_id){
|
|
|
- \Log::info('action_call_ycsd_old_order_continue:'.$param['order_sn']);
|
|
|
- }else{
|
|
|
- \Log::info('action_call_ycsd_has_change_pay_return:'.$distribution_channel_id);
|
|
|
- return '';
|
|
|
- }
|
|
|
- }else{
|
|
|
- \Log::info('action_call_ycsd_has_change_pay_return:'.$distribution_channel_id);
|
|
|
- return '';
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- \Log::info('action_call_ycsd:'.$distribution_channel_id);
|
|
|
- }
|
|
|
-
|
|
|
- $data = [];
|
|
|
- $data['send_time'] = date("Y-m-d H:i:s");
|
|
|
- $data['action_type'] = $action_type;
|
|
|
- if($action_type == 'Register'){
|
|
|
- $data['openid'] = $param['openid'];
|
|
|
- $data['uid'] = $param['uid'];
|
|
|
- }elseif($action_type == 'CreateOrder'){
|
|
|
- $data['orderSn'] = $param['order_sn'];
|
|
|
- $data['amount'] = $param['amount'];
|
|
|
- $data['openid'] = $param['openid'];
|
|
|
- $data['uid'] = $param['uid'];
|
|
|
- }elseif($action_type == 'CallBackOrder'){
|
|
|
- $data['orderSn'] = $param['order_sn'];
|
|
|
- $data['openid'] = $param['openid'];
|
|
|
- }
|
|
|
-
|
|
|
- $send_data=array(
|
|
|
- 'send_time'=>date("Y-m-d H:i:s"),
|
|
|
- 'data' => $data
|
|
|
- );
|
|
|
- \Log::info('PushUserActionToQueue_openid:'.$data['openid'].' action_type:'.$action_type);
|
|
|
- \Log::info('$send_data');\Log::info($send_data);
|
|
|
-
|
|
|
- $delay = 0;
|
|
|
-
|
|
|
- $job = (new ActionTrigger($send_data))->onConnection('rabbitmq')->delay($delay)->onQueue('action_trigger_list');
|
|
|
- dispatch($job);
|
|
|
- }catch(\Exception $e){
|
|
|
- \Log::info('ept:'.$e->getMessage());
|
|
|
- }
|
|
|
+ static function PushUserActionToQueue($action_type, $distribution_channel_id, $param)
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ // \Log::info('PushUserActionToQueue_param_start:'.$distribution_channel_id.' action_type:'.$action_type. ' param:'.json_encode($param));
|
|
|
+
|
|
|
+ // 判断站点是否需要额外逻辑
|
|
|
+ $distribution_self_define_config = DistributionSelfDefineConfig::getDistributionSelfDefineConfig($distribution_channel_id, 'action_call_ycsd');
|
|
|
+ if (empty($distribution_self_define_config)) {
|
|
|
+ // \Log::info('not_action_call_ycsd:'.$distribution_channel_id);
|
|
|
+ return '';
|
|
|
+ } else {
|
|
|
+ \Log::info('PushUserActionToQueue_param:' . $distribution_channel_id . ' action_type:' . $action_type . ' param:' . json_encode($param));
|
|
|
+ // 如果支付通道已经切换回去,则不推送了
|
|
|
+ // $pay_merchant_id = env('YCSD_CALL_PAY_MERCHANT_ID');
|
|
|
+
|
|
|
+ // 当前默认
|
|
|
+ $pay_merchant_id = Redis::get('YCSD_CALL_PAY_MERCHANT_ID');
|
|
|
+ $channel = Channel::getById($distribution_channel_id);
|
|
|
+ $current_pay_merchant_id = isset($channel->pay_merchant_id) ? $channel->pay_merchant_id : '';
|
|
|
+ \Log::info('action_call_ycsd:' . $distribution_channel_id . ' $pay_merchant_id:' . $pay_merchant_id . ' $current_pay_merchant_id:' . $current_pay_merchant_id);
|
|
|
+ if ($current_pay_merchant_id != $pay_merchant_id) {
|
|
|
+ // 判断订单是否是默认支付,放行,切换期间的bug
|
|
|
+ if ($action_type == 'CallBackOrder') {
|
|
|
+ $order = Order::getByTradeNo($distribution_channel_id, $param['order_sn']);
|
|
|
+ if (isset($order->pay_merchant_id) && $order->pay_merchant_id == $pay_merchant_id) {
|
|
|
+ \Log::info('action_call_ycsd_old_order_continue:' . $param['order_sn']);
|
|
|
+ } else {
|
|
|
+ \Log::info('action_call_ycsd_has_change_pay_return:' . $distribution_channel_id);
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ \Log::info('action_call_ycsd_has_change_pay_return:' . $distribution_channel_id);
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ \Log::info('action_call_ycsd:' . $distribution_channel_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ $data = [];
|
|
|
+ $data['send_time'] = date("Y-m-d H:i:s");
|
|
|
+ $data['action_type'] = $action_type;
|
|
|
+ if ($action_type == 'Register') {
|
|
|
+ $data['openid'] = $param['openid'];
|
|
|
+ $data['uid'] = $param['uid'];
|
|
|
+ } elseif ($action_type == 'CreateOrder') {
|
|
|
+ $data['orderSn'] = $param['order_sn'];
|
|
|
+ $data['amount'] = $param['amount'];
|
|
|
+ $data['openid'] = $param['openid'];
|
|
|
+ $data['uid'] = $param['uid'];
|
|
|
+ } elseif ($action_type == 'CallBackOrder') {
|
|
|
+ $data['orderSn'] = $param['order_sn'];
|
|
|
+ $data['openid'] = $param['openid'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $send_data = array(
|
|
|
+ 'send_time' => date("Y-m-d H:i:s"),
|
|
|
+ 'data' => $data
|
|
|
+ );
|
|
|
+ \Log::info('PushUserActionToQueue_openid:' . $data['openid'] . ' action_type:' . $action_type);
|
|
|
+ \Log::info('$send_data');
|
|
|
+ \Log::info($send_data);
|
|
|
+
|
|
|
+ $delay = 0;
|
|
|
+
|
|
|
+ $job = (new ActionTrigger($send_data))->onConnection('rabbitmq')->delay($delay)->onQueue('action_trigger_list');
|
|
|
+ dispatch($job);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ \Log::info('ept:' . $e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- public static function isCpcUser($uid){
|
|
|
+ public static function isCpcUser($uid)
|
|
|
+ {
|
|
|
//openid下所有强关超过三天的uid都无充值,对强关后的uid进行曝光
|
|
|
//openid下有一个强关超过三天的uid,都无充值,对强关后的uid进行曝光
|
|
|
$sql_format = "SELECT u.id,f.subscribe_time,(SELECT id from orders where uid = u.id and `status` = 'PAID' LIMIT 1)as oid FROM users u
|
|
|
JOIN force_subscribe_users f on u.id = f.uid and f.is_subscribed= 1
|
|
|
WHERE u.openid in (SELECT openid from users WHERE id = %s)";
|
|
|
- $result = DB::select(sprintf($sql_format,$uid));
|
|
|
- if(!$result) return false;
|
|
|
+ $result = DB::select(sprintf($sql_format, $uid));
|
|
|
+ if (!$result) return false;
|
|
|
|
|
|
- $is_has_force_subscribe_three_days =false;
|
|
|
- foreach ($result as $item){
|
|
|
+ $is_has_force_subscribe_three_days = false;
|
|
|
+ foreach ($result as $item) {
|
|
|
//有充值
|
|
|
- if($item->oid) return false;
|
|
|
+ if ($item->oid) return false;
|
|
|
//强关没超过超过三天
|
|
|
//if(time()-strtotime($item->subscribe_time) < 86400*3) return false;
|
|
|
- if(time()-strtotime($item->subscribe_time) > 86400*3) $is_has_force_subscribe_three_days = true;
|
|
|
+ if (time() - strtotime($item->subscribe_time) > 86400 * 3) $is_has_force_subscribe_three_days = true;
|
|
|
}
|
|
|
return $is_has_force_subscribe_three_days;
|
|
|
}
|
|
|
|
|
|
- public static function recordUA($ua,$uid)
|
|
|
+ public static function recordUA($ua, $uid)
|
|
|
{
|
|
|
- return UserEnv::recordUA($ua,$uid);
|
|
|
+ return UserEnv::recordUA($ua, $uid);
|
|
|
}
|
|
|
|
|
|
- public static function transfer(int $from,int $to,int $distribution_channel_id){
|
|
|
- $transfer_record = DB::table('crm_transfer')->where('from_uid',$from)->first();
|
|
|
- if($transfer_record){
|
|
|
- return ;
|
|
|
+ public static function transfer(int $from, int $to, int $distribution_channel_id)
|
|
|
+ {
|
|
|
+ $transfer_record = DB::table('crm_transfer')->where('from_uid', $from)->first();
|
|
|
+ if ($transfer_record) {
|
|
|
+ return;
|
|
|
}
|
|
|
$from_user = self::getById($from);
|
|
|
$to_user = self::getById($to);
|
|
|
- if(!$from_user) return ;
|
|
|
- if(!$to_user) return ;
|
|
|
+ if (!$from_user) return;
|
|
|
+ if (!$to_user) return;
|
|
|
//阅读记录迁移***************************************
|
|
|
- $record = Redis::hgetall('book_read:'.$from);
|
|
|
- $not_uid_key = ['last_read','sign_counts','sign_info','sign_day'];
|
|
|
+ $record = Redis::hgetall('book_read:' . $from);
|
|
|
+ $not_uid_key = ['last_read', 'sign_counts', 'sign_info', 'sign_day'];
|
|
|
$data = [];
|
|
|
- foreach ($record as $k=>$item){
|
|
|
- if(is_numeric($k) || in_array($k,$not_uid_key)){
|
|
|
+ foreach ($record as $k => $item) {
|
|
|
+ if (is_numeric($k) || in_array($k, $not_uid_key)) {
|
|
|
$data[$k] = $item;
|
|
|
}
|
|
|
}
|
|
|
//\Log::info('read record is');
|
|
|
//\Log::info($data);
|
|
|
- if($data) Redis::hmset('book_read:'.$to,$data);
|
|
|
+ if ($data) Redis::hmset('book_read:' . $to, $data);
|
|
|
//签到记录
|
|
|
/*$user_sign_model = new UserSign();
|
|
|
$user_sign_model->setCurrentTable(date('Ym'));
|
|
@@ -415,19 +435,19 @@ WHERE u.openid in (SELECT openid from users WHERE id = %s)";
|
|
|
DB::table('user_sign'.date('Ym'))->insert($temp);
|
|
|
}*/
|
|
|
//订阅记录(按本)
|
|
|
- $book_order = BookOrder::where('uid',$from)->where('bid','>',0)->get();
|
|
|
- if($book_order){
|
|
|
+ $book_order = BookOrder::where('uid', $from)->where('bid', '>', 0)->get();
|
|
|
+ if ($book_order) {
|
|
|
$temp = [];
|
|
|
- foreach ($book_order as $book){
|
|
|
+ foreach ($book_order as $book) {
|
|
|
$temp[] = [
|
|
|
- 'distribution_channel_id'=>$distribution_channel_id,
|
|
|
- 'bid'=>$book->bid,
|
|
|
- 'book_name'=>$book->book_name,
|
|
|
- 'uid'=>$to,
|
|
|
- 'u'=>$book->u,
|
|
|
- 'fee'=>0,
|
|
|
- 'created_at'=>$book->created_at,
|
|
|
- 'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
+ 'distribution_channel_id' => $distribution_channel_id,
|
|
|
+ 'bid' => $book->bid,
|
|
|
+ 'book_name' => $book->book_name,
|
|
|
+ 'uid' => $to,
|
|
|
+ 'u' => $book->u,
|
|
|
+ 'fee' => 0,
|
|
|
+ 'created_at' => $book->created_at,
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s'),
|
|
|
];
|
|
|
}
|
|
|
//\Log::info('book_order is');
|
|
@@ -435,52 +455,52 @@ WHERE u.openid in (SELECT openid from users WHERE id = %s)";
|
|
|
DB::table('book_orders')->insert($temp);
|
|
|
}
|
|
|
//订阅记录(按章)
|
|
|
- $chapter_order_record = ChapterOrderService::getRecordByUid($from,'','',true);
|
|
|
- if($chapter_order_record){
|
|
|
+ $chapter_order_record = ChapterOrderService::getRecordByUid($from, '', '', true);
|
|
|
+ if ($chapter_order_record) {
|
|
|
$temp = [];
|
|
|
$i = 1;
|
|
|
$chapter_model = new ChapterOrder();
|
|
|
$chapter_model->setCurrentTable($to);
|
|
|
|
|
|
- foreach ($chapter_order_record as $chapter_order){
|
|
|
+ foreach ($chapter_order_record as $chapter_order) {
|
|
|
$temp[] = [
|
|
|
- 'distribution_channel_id'=>$distribution_channel_id,
|
|
|
- 'bid'=>$chapter_order->bid,
|
|
|
- 'cid'=>$chapter_order->cid,
|
|
|
- 'chapter_name'=>$chapter_order->chapter_name,
|
|
|
- 'book_name'=>$chapter_order->book_name,
|
|
|
- 'uid'=>$to,
|
|
|
- 'send_order_id'=>0,
|
|
|
- 'fee'=>0,
|
|
|
- 'created_at'=>$chapter_order->created_at,
|
|
|
- 'updated_at'=>date('Y-m-d H:i:s')
|
|
|
+ 'distribution_channel_id' => $distribution_channel_id,
|
|
|
+ 'bid' => $chapter_order->bid,
|
|
|
+ 'cid' => $chapter_order->cid,
|
|
|
+ 'chapter_name' => $chapter_order->chapter_name,
|
|
|
+ 'book_name' => $chapter_order->book_name,
|
|
|
+ 'uid' => $to,
|
|
|
+ 'send_order_id' => 0,
|
|
|
+ 'fee' => 0,
|
|
|
+ 'created_at' => $chapter_order->created_at,
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s')
|
|
|
];
|
|
|
- if($i % 100 == 0){
|
|
|
+ if ($i % 100 == 0) {
|
|
|
$chapter_model->insert($temp);
|
|
|
$temp = [];
|
|
|
}
|
|
|
- $i ++;
|
|
|
+ $i++;
|
|
|
}
|
|
|
//\Log::info('chapter order is');
|
|
|
//\Log::info($temp);
|
|
|
$chapter_model->insert($temp);
|
|
|
}
|
|
|
//打赏记录
|
|
|
- $gift_result = BookGiftsSend::where('uid',$from)->get();
|
|
|
- if($gift_result){
|
|
|
+ $gift_result = BookGiftsSend::where('uid', $from)->get();
|
|
|
+ if ($gift_result) {
|
|
|
$tmp = [];
|
|
|
- foreach ($gift_result as $g){
|
|
|
+ foreach ($gift_result as $g) {
|
|
|
$tmp[] = [
|
|
|
- 'uid'=>$to,
|
|
|
- 'gift_id'=>$g->gift_id,
|
|
|
- 'bid'=>$g->bid,
|
|
|
- 'icon'=>$g->icon,
|
|
|
- 'name_desc'=>$g->name_desc,
|
|
|
- 'cost'=>0,
|
|
|
- 'cost_reward'=>$g->cost_reward,
|
|
|
- 'cost_recharge'=>$g->cost_recharge,
|
|
|
- 'created_at'=>$g->created_at,
|
|
|
- 'updated_at'=>date('Y-m-d H:i:s')
|
|
|
+ 'uid' => $to,
|
|
|
+ 'gift_id' => $g->gift_id,
|
|
|
+ 'bid' => $g->bid,
|
|
|
+ 'icon' => $g->icon,
|
|
|
+ 'name_desc' => $g->name_desc,
|
|
|
+ 'cost' => 0,
|
|
|
+ 'cost_reward' => $g->cost_reward,
|
|
|
+ 'cost_recharge' => $g->cost_recharge,
|
|
|
+ 'created_at' => $g->created_at,
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s')
|
|
|
];
|
|
|
}
|
|
|
//\Log::info('book gift is');
|
|
@@ -488,16 +508,16 @@ WHERE u.openid in (SELECT openid from users WHERE id = %s)";
|
|
|
DB::table('book_gifts_send')->insert($tmp);
|
|
|
}
|
|
|
//书架
|
|
|
- $result = UserShelfBooks::where('uid',$from)->get();
|
|
|
- if($result){
|
|
|
+ $result = UserShelfBooks::where('uid', $from)->get();
|
|
|
+ if ($result) {
|
|
|
$tmp = [];
|
|
|
- foreach ($result as $s){
|
|
|
+ foreach ($result as $s) {
|
|
|
$tmp[] = [
|
|
|
- 'uid'=>$to,
|
|
|
- 'distribution_channel_id'=>$distribution_channel_id,
|
|
|
- 'bid'=>$s->bid,
|
|
|
- 'created_at'=>$s->created_at,
|
|
|
- 'updated_at'=>date('Y-m-d H:i:s')
|
|
|
+ 'uid' => $to,
|
|
|
+ 'distribution_channel_id' => $distribution_channel_id,
|
|
|
+ 'bid' => $s->bid,
|
|
|
+ 'created_at' => $s->created_at,
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s')
|
|
|
];
|
|
|
}
|
|
|
//\Log::info('user book shelf is');
|
|
@@ -505,17 +525,17 @@ WHERE u.openid in (SELECT openid from users WHERE id = %s)";
|
|
|
DB::table('user_shelf_books')->insert($tmp);
|
|
|
}
|
|
|
//包年
|
|
|
- $result = DB::table('year_orders')->where('uid',$from)->where('end_time','>=',date('Y-m-d H:i:s'))->first();
|
|
|
- if($result){
|
|
|
+ $result = DB::table('year_orders')->where('uid', $from)->where('end_time', '>=', date('Y-m-d H:i:s'))->first();
|
|
|
+ if ($result) {
|
|
|
DB::table('year_orders')->insert([
|
|
|
- 'uid'=>$to,
|
|
|
- 'begin_time'=>$result->begin_time,
|
|
|
- 'end_time'=>$result->end_time,
|
|
|
- 'distribution_channel_id'=>$distribution_channel_id,
|
|
|
- 'send_order_id'=>$result->send_order_id,
|
|
|
- 'fee'=>$result->fee,
|
|
|
- 'created_at'=>date('Y-m-d H:i:s'),
|
|
|
- 'updated_at'=>$result->updated_at,
|
|
|
+ 'uid' => $to,
|
|
|
+ 'begin_time' => $result->begin_time,
|
|
|
+ 'end_time' => $result->end_time,
|
|
|
+ 'distribution_channel_id' => $distribution_channel_id,
|
|
|
+ 'send_order_id' => $result->send_order_id,
|
|
|
+ 'fee' => $result->fee,
|
|
|
+ 'created_at' => date('Y-m-d H:i:s'),
|
|
|
+ 'updated_at' => $result->updated_at,
|
|
|
]);
|
|
|
//\Log::info('year_orders is');
|
|
|
//print_r($result);
|
|
@@ -533,16 +553,16 @@ WHERE u.openid in (SELECT openid from users WHERE id = %s)";
|
|
|
$to_user->province = $from_user->province;
|
|
|
$to_user->save();
|
|
|
DB::table('crm_transfer')->insert([
|
|
|
- 'from_uid'=>$from,
|
|
|
- 'to_uid'=>$to,
|
|
|
- 'is_enable'=>1,
|
|
|
- 'created_at'=>date('Y-m-d H:i:s'),
|
|
|
- 'updated_at'=>date('Y-m-d H:i:s')
|
|
|
+ 'from_uid' => $from,
|
|
|
+ 'to_uid' => $to,
|
|
|
+ 'is_enable' => 1,
|
|
|
+ 'created_at' => date('Y-m-d H:i:s'),
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s')
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
public static function getUserByOpenid($openid)
|
|
|
{
|
|
|
- return User::where('openid',$openid)->get();
|
|
|
+ return User::where('openid', $openid)->get();
|
|
|
}
|
|
|
-}
|
|
|
+}
|