首页 > 其他分享 >1

1

时间:2024-12-06 21:34:38浏览次数:2  
标签: needScore ip app score php id

php

目录app/admin/controller/v1/AdminController.php底部

public function uploadImg()
{
    $file = request()->file('img');
    if ($file) {
        $savename = \think\facade\Filesystem::disk('public')->putFile('common', $file, 'uniqid');
        $img_url = config('app.IMG_PREFIX') . config('app.ROOT_FOLDER') . 'public/storage/' . $savename;
        return ResponseData::returnJson($img_url, 'true');
    }
    return ResponseData::returnJson("", 'false');
​
}

目录app/admin/route/app.php底部

Route::Post(':version/uploadImg', ':version.AdminController/uploadImg');

目录app/admin/model/Member.php的216行

elseif($activityId == 31){
    $tagActivity = "24年10月转盘活动";
}
elseif($activityId == 31){
    $originActivity = "2024.10转盘活动";
}

 

目录app/admin/model/ScoreOrder.php

21行

$hidden后面添加:, 'score', 'real_goods_order_id'

66行

exchangePhoneBill里面添加:, $score

133行

ip下面添加

'score' => $score

目录app/api/controller/v1

240行的try里面

//2.扣除积分
Member::where('id', $memberId)->dec('score', (int)$needScore)->inc('totalCostScore', (int)$needScore)->inc('annualCostScore', (int)$needScore)->update();

            //3.插入订单

            $last_res_id = Db::name('realgoodsorder')->insertGetId([
                'member_id' => $memberId,
                'type' => $type,
                'pro_name' => $proname,
                'specification' => $spec,
                'receive_name' => input('post.receive_name'),
                'receive_add' => input('post.receive_add'),
                'phone' => $phone,
                'createdAt' => date('Y-m-d H:i:s'),
                'ip' => $ip,
            ]);

            //1.加入积分记录表
ScoreOrderModel::insert([
    'member_id' => $memberId,
    'phone' => $phone,
    'isCanceled' => 'false',
    'createdAt' => date('Y-m-d H:i:s'),
    'updatedAt' => date('Y-m-d H:i:s'),
    'exchangeStatus' => '0',
    'rewardType' => $type,
    'usefulDate' => $proname,
    'ip' => $ip,
    'isDeleted' => 'false',
                'score' => $needScore,
                'real_goods_order_id' => $last_res_id
]);

717行的$res后面追加

, $reward_info[$value][1]

 

 

后面要重新设置下菜单栏,修改活动id,发完后要注释了两个自定义菜单栏和exchange

 

 

标签:,needScore,ip,app,score,php,id
From: https://www.cnblogs.com/warrenwt/p/18591045

相关文章