作者 梁鹏山

新增接口开发、后台功能开发

... ... @@ -118,6 +118,8 @@ class Cm0order0zan extends Backend
}
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
$result = false;
... ... @@ -131,8 +133,16 @@ class Cm0order0zan extends Backend
}
$params = $this->tuiOrder($row, $params,$ids);
//添加有效期
$type = $row->where('id', $ids)->value('type');
if (($params['wc'] == '1' || $params['wc'] == '3')&& $type == '2'){
$expire = config('site.expire');
$day = 86400*$expire;
$have_expire = time()+$day;
$params['expiretime'] = $have_expire;
}
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
... ...
... ... @@ -309,7 +309,6 @@ class My extends Api
$data = array_merge($data1, $data2);
}
//最后利用创建时间进行排序
$timeKey = array_column($data, 'createtime');
array_multisort($timeKey, SORT_DESC, $data);
... ...
... ... @@ -40,10 +40,30 @@ class Newadd extends Api
*/
public function getUserInfo()
{
/** 用户信息 */
$id = $this->auth->id;
$userinfo = User::get($id);
$log = new UserMoneyLog();
$money_log = $log->where('user_id', $id)->select();
/** 用户账户明细 */
$money_log = $log->alias('l')
->join('user u', 'l.f_id = u.id', 'left')
->where('l.user_id', $id)
->field('l.*, u.avatar, a.nickname, a.mobile')
->select();
/** 佣金明细 */
$list = [];
foreach ($money_log as $v){
if ($v['type'] == '+'){
$list[] = $v;
}
}
$data = [
'userinfo'=>$userinfo,
'money_log'=>$money_log,
'commission'=>$list
];
$this->success('ok', $data);
}
/**
... ...