...
|
...
|
@@ -18,6 +18,7 @@ use app\mobile\model\CompanyJob; |
|
|
use app\mobile\model\UserJob;
|
|
|
use app\mobile\model\CompanyJobResume;
|
|
|
use app\mobile\model\UserJobDownload;
|
|
|
use app\mobile\model\Message;
|
|
|
use addons\epay\library\Service;
|
|
|
use Endroid\QrCode\QrCode;
|
|
|
|
...
|
...
|
@@ -215,7 +216,24 @@ class Company extends Api |
|
|
empty($company_user_id) && $this->error('缺少必需参数');
|
|
|
$info = CompanyUser::get($company_user_id);
|
|
|
empty($info) && $this->error('申请信息不存在');
|
|
|
$info->save(['status'=>'1']);
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
$info->save(['status'=>'1']);
|
|
|
// 发送消息
|
|
|
$company_name = $this->model->where('id',$info['company_id'])->value('name');
|
|
|
Message::create([
|
|
|
'user_id' => $info['user_id'],
|
|
|
'title' => '加入企业-成功',
|
|
|
'content' => '您的加入'.$company_name.'企业的申请已通过,该企业的学习自老您都可以免费共享了哦,快去试试吧。'
|
|
|
]);
|
|
|
Db::commit();
|
|
|
} catch (PDOException $e) {
|
|
|
Db::rollback();
|
|
|
$this->error($e->getMessage());
|
|
|
} catch (Exception $e) {
|
|
|
Db::rollback();
|
|
|
$this->error($e->getMessage());
|
|
|
}
|
|
|
$this->success('同意加入成功');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -241,7 +259,24 @@ class Company extends Api |
|
|
empty($company_user_id) && $this->error('缺少必需参数');
|
|
|
$info = CompanyUser::get($company_user_id);
|
|
|
empty($info) && $this->error('申请信息不存在');
|
|
|
$info->save(['status'=>'2']);
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
$info->save(['status'=>'2']);
|
|
|
// 发送消息
|
|
|
$company_name = $this->model->where('id',$info['company_id'])->value('name');
|
|
|
Message::create([
|
|
|
'user_id' => $info['user_id'],
|
|
|
'title' => '加入企业-失败',
|
|
|
'content' => '您的加入'.$company_name.'企业的申请失败了,联系企业管理员后重新申请下吧。'
|
|
|
]);
|
|
|
Db::commit();
|
|
|
} catch (PDOException $e) {
|
|
|
Db::rollback();
|
|
|
$this->error($e->getMessage());
|
|
|
} catch (Exception $e) {
|
|
|
Db::rollback();
|
|
|
$this->error($e->getMessage());
|
|
|
}
|
|
|
$this->success('拒绝成功');
|
|
|
}
|
|
|
|
...
|
...
|
|