update
This commit is contained in:
parent
2a6e85fea5
commit
427ac7a98f
@ -57,7 +57,7 @@
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return MarketingContract::withoutField('update_time,delete_time')->where($this->searchWhere)->where('contract_type', 1)
|
return MarketingContract::withoutField('update_time,delete_time')->where($this->searchWhere)->where('contract_type', 1)->where('is_related',0)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function ($data) {
|
->select()->each(function ($data) {
|
||||||
@ -93,7 +93,7 @@
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
return MarketingContract::where($this->searchWhere)->where('contract_type', 1)->count();
|
return MarketingContract::where($this->searchWhere)->where('contract_type', 1)->where('is_related',0)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -97,6 +97,11 @@
|
|||||||
'create_user' => $params['create_user'],
|
'create_user' => $params['create_user'],
|
||||||
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : time(),
|
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : time(),
|
||||||
]);
|
]);
|
||||||
|
if($params['related_contract_id'] > 0){
|
||||||
|
MarketingContract::where('id', $params['related_contract_id'])->update([
|
||||||
|
'is_related' => 1
|
||||||
|
]);
|
||||||
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -164,6 +169,11 @@
|
|||||||
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : time(),
|
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : time(),
|
||||||
'update_time' => time()
|
'update_time' => time()
|
||||||
]);
|
]);
|
||||||
|
if($params['related_contract_id'] > 0){
|
||||||
|
MarketingContract::where('id', $params['related_contract_id'])->update([
|
||||||
|
'is_related' => 1
|
||||||
|
]);
|
||||||
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user